/**
 * @author: Niimp
 * @date: 2023/11/30 13:00
 * @statement:
 */
package com.dmgis.hndz.controller;

import com.alibaba.fastjson.JSONObject;
import com.dmgis.hndz.service.UserInfoService;
import com.dmgis.hndz.common.result.HttpStatusEnum;
import com.dmgis.hndz.common.result.ResponseResult;
import com.dmgis.hndz.pojoVo.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = "用户信息")
@RestController
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    @ApiOperation(value = "登录")
    @PostMapping("/login")
    @ResponseBody
    @ApiImplicitParams({
            @ApiImplicitParam(name = "ggyh01a020", value = "账号", required = true, defaultValue = "admin", dataType = "String", paramType = "query"),
            @ApiImplicitParam(name = "ggyh01a030", value = "密码", required = true, defaultValue = "admin", dataType = "String", paramType = "query"),
    })
    public ResponseResult queryThreeDayWeatherForecast(@RequestBody JSONObject jsonObject) {
        LoginVo login = userInfoService.login(jsonObject);
        return new ResponseResult(HttpStatusEnum.SUCCESS.getCode(), true, "查询成功", login);
    }
}


